|
currentsens 2.2.0
|
This file contains API for Current Sens Click Driver. More...
#include "drv_digital_out.h"#include "drv_digital_in.h"#include "drv_analog_in.h"#include "drv_spi_master.h"#include "spi_specifics.h"Go to the source code of this file.
Data Structures | |
| struct | currentsens_t |
| Current Sens Click context object. More... | |
| struct | currentsens_cfg_t |
| Current Sens Click configuration object. More... | |
Macros | |
| #define | CURRENTSENS_NUM_CONVERSIONS 200 |
| Current Sens default ADC samples number for averaging. | |
| #define | CURRENTSENS_ADC_RESOLUTION 0x0FFF |
| Current Sens ADC setting. | |
| #define | CURRENTSENS_VREF_2V5 2.5 |
| #define | CURRENTSENS_VREF_3V3 3.3 |
| #define | CURRENTSENS_VREF_5V 5.0 |
| #define | CURRENTSENS_TIMEOUT_MS 2000 |
| Current Sens timeout setting. | |
| #define | CURRENTSENS_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE |
| Data sample selection. | |
| #define | CURRENTSENS_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE |
| #define | CURRENTSENS_MAP_MIKROBUS(cfg, mikrobus) |
| MikroBUS pin mapping. | |
Enumerations | |
| enum | currentsens_drv_t { CURRENTSENS_DRV_SEL_ADC , CURRENTSENS_DRV_SEL_SPI } |
| Current Sens Click driver selector. More... | |
| enum | currentsens_return_value_t { CURRENTSENS_OK = 0 , CURRENTSENS_ERROR = -1 } |
| Current Sens Click return value data. More... | |
Functions | |
| void | currentsens_cfg_setup (currentsens_cfg_t *cfg) |
| Current Sens configuration object setup function. | |
| void | currentsens_drv_interface_sel (currentsens_cfg_t *cfg, currentsens_drv_t drv_sel) |
| Current Sens driver interface setup function. | |
| err_t | currentsens_init (currentsens_t *ctx, currentsens_cfg_t *cfg) |
| Current Sens initialization function. | |
| err_t | currentsens_read_raw_adc (currentsens_t *ctx, uint16_t *raw_adc) |
| Current Sens read raw ADC value function. | |
| err_t | currentsens_read_voltage (currentsens_t *ctx, float *voltage) |
| Current Sens read voltage level function. | |
| err_t | currentsens_read_voltage_avg (currentsens_t *ctx, uint16_t num_conv, float *voltage_avg) |
| Current Sens read average voltage level function. | |
| err_t | currentsens_set_vref (currentsens_t *ctx, float vref) |
| Current Sens set vref function. | |
| err_t | currentsens_calib_offset (currentsens_t *ctx) |
| Current Sens calib offset function. | |
| err_t | currentsens_calib_resolution (currentsens_t *ctx, float calib_current) |
| Current Sens calib resolution function. | |
| err_t | currentsens_read_current (currentsens_t *ctx, float *current) |
| Current Sens read current function. | |
This file contains API for Current Sens Click Driver.
| enum currentsens_drv_t |